using System;

namespace ZapprService {
	/// <summary>
	/// Class DBInformation
	/// </summary>
	class DBInfo {
		public static DBInfo Current = new DBInfo();

		private int m_iOnline = 0;

		private string m_strServer;
		private string m_strDatabase;
		private string m_strDatabaseUser;
		private string m_strPassword;
		private string m_strUsername;
		private string m_strDefaultIDName;
		private bool m_bTrustCn = false;
		private string m_strServerConfigfile;
		private string m_strServerPath;
		
		/// <summary>
		/// Default Constructor
		/// </summary>
		private DBInfo() {
			switch(m_iOnline){
				case 0:
					// ONLINE
					m_strServer = "123.132.123.123\\MSSQL";
					m_strDatabase = "zonotope";
					m_strDatabaseUser = "dbo";
					m_strPassword = "pw";
					m_strUsername = "usr";
					m_strDefaultIDName = "pkid";
					m_bTrustCn = false;
					
					m_strServerConfigfile = "D:/web_ToendaZappr/WebSite/Configuration/Configuration.xml";
					//m_strServerConfigfile = "D:/Privat/Zappr Photo Management/WebClient/Configuration/Configuration.xml";
					//m_strServerConfigfile = "E:/Development/C#/Zappr Photo Management/WebClient/Configuration/Configuration.xml";
					
					m_strServerPath = "D:/web_ToendaZappr/WebSite/";
					//m_strServerPath = "D:/Privat/Zappr Photo Management/WebClient/";
					//m_strServerPath = "E:/Development/C#/Zappr Photo Management/WebClient/";
					break;

				case 3:
					// JONATHAN
					m_strServer = "VD\\VDSQL";
					m_strDatabase = "zonotope";
					m_strDatabaseUser = "dbo";
					m_strPassword = "banane";
					m_strUsername = "sa";
					m_strDefaultIDName = "pkid";
					m_bTrustCn = false;
					//m_strServerConfigfile = "D:/web_jobseite/WebClient/Configuration/Configuration.xml";
					m_strServerConfigfile = "E:/Development/C#/Zappr Photo Management/WebClient/Configuration/Configuration.xml";
					//m_strServerPath = "D:/web_jobseite/WebClient/";
					m_strServerPath = "E:/Development/C#/Zappr Photo Management/WebClient/";
					break;
			}
		}

		/// <summary>
		/// Get server
		/// </summary>
		public string Server {
			get { return m_strServer; }
		}

		/// <summary>
		/// Get Trusted Connection
		/// </summary>
		public string TrustCn {
			get {
				if(m_bTrustCn) return "Trusted_Connection=" + m_bTrustCn + "; ";
				else return "";
			}
		}

		/// <summary>
		/// Get Database
		/// </summary>
		public string Database {
			get { return m_strDatabase; }
		}

		/// <summary>
		/// Get Database User
		/// </summary>
		public string DatabaseUser {
			get { return m_strDatabaseUser; }
		}

		/// <summary>
		/// Get Password
		/// </summary>
		public string Password {
			get { return m_strPassword; }
		}

		/// <summary>
		/// Get Username
		/// </summary>
		public string Username {
			get { return m_strUsername; }
		}

		/// <summary>
		/// Get default table primary key id
		/// </summary>
		public string IDName {
			get { return m_strDefaultIDName; }
		}

		/// <summary>
		/// Get a new GUID
		/// </summary>
		public string NewGUID {
			get { return Guid.NewGuid().ToString(); }
		}

		/// <summary>
		/// Get the ServerConfigfile
		/// </summary>
		public string ServerConfigfile {
			get { return m_strServerConfigfile; }
		}

		/// <summary>
		/// Get the ServerPath
		/// </summary>
		public string ServerPath {
			get { return m_strServerPath; }
		}
	}
}
